package com.UnionPayCenter.service;

import com.UnionPayCenter.entity.CouponEntity;
import com.UnionPayCenter.entity.MpIndexPageEntity;
import com.UnionPayCenter.entity.ShopEntity;
import com.UnionPayCenter.entity.ShopInfoEntity;
import com.UnionPayCenter.entity.UserEntity;
import com.UnionPayCenter.entity.vo.UserVo;
import com.UnionPayCenter.operation.entity.request.MpPushRequest;
import com.UnionPayCenter.operation.entity.request.MpPushToAllRequest;
import com.alibaba.fastjson.JSONObject;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

public interface IWechatService {

    String mpBack(HttpServletRequest request, HttpServletResponse response);

    /**
     * @Description: 卡券领取模版消息
     * @Param:
     * @return:
     * @Author: bite
     * @Date: 2019/6/16
     */
    boolean sendCardMsg(UserVo user, ShopEntity shop, ShopInfoEntity shopInfo);

    /**
     * @Description: 充值模版消息
     * @Param: wxOpenid 会员公众号openid 存在才发送
     * amount 充值金额
     * time 充值时间
     * balance 余额
     * shopId 商铺id
     * @return:
     * @Author: bite
     * @Date: 2019/6/16
     */
    boolean sendDepositMsg(UserEntity user, String amount, String time, String balance, String sn, Integer shopId);

    /**
     * @Description: 支付模版消息
     * @Param: wxOpenid 会员公众号openid 存在才发送
     * sn      流水编号
     * time    记录时间，精确到秒
     * amount  消费金额
     * type    余额支付/微信支付
     * shopId  商铺id
     * @return:
     * @Author: bite
     * @Date: 2019/6/16
     */
    boolean sendPayMsg(UserEntity user, String sn, String time, String amount, String balance, String type, Integer shopId);

    /**
     * 推送消息
     *
     * @param mpPushRequest 推送参数
     * @return
     */
    boolean pushMpMsg(MpPushRequest mpPushRequest);

    /**
     * 全部推送
     *
     * @param mpPushRequest
     * @return
     */
    boolean pushMpMsgToAll(MpPushToAllRequest mpPushRequest);

    boolean pushCouponsNotify(Integer shopId, Integer userId, CouponEntity couponEntity, String endTime, Integer quantity);

    /**
     * @Description: 微信支付
     * @Param:
     * @return:
     * @Author: bite
     * @Date: 2019/6/29
     */
    JSONObject pay(Integer userId, Integer shopId, int amount, String sn);

    /**
     * @Description: 银联支付
     * @Param:
     * @return:
     * @Author: bite
     * @Date: 2019/6/29
     */
    JSONObject unionPay(Integer userId, Integer shopId, int amount, String sn);

    /**
     * 查询formid
     *
     * @param userId 用户id
     * @return formId
     */
    String getFormid(Integer userId);

    /**
     * 查询formid
     *
     * @param userId
     * @param delete 是否删除
     * @return
     */
    String getFormid(Integer userId, boolean delete);

    /**
     * @Description: 创建会员卡
     * @Param:
     * @return:
     * @Author: bite
     * @Date: 2019/7/9
     */
    String createCard(Integer shopId, Integer infoId);

    /**
     * @Description: 修改会员卡
     * @Param:
     * @return:
     * @Author: bite
     * @Date: 2019/7/14
     */
    boolean updateCard(Integer shopId, Integer infoId);

    /**
     * @Description: 设置开卡字段接口
     * @Param:
     * @return:
     * @Author: bite
     * @Date: 2019/7/9
     */
    boolean setCard(Integer shopId, Integer infoId);

    /**
     * @Description: 根据卡拉取会员信息接口
     * @Param:
     * @return:
     * @Author: bite
     * @Date: 2019/7/9
     */
    JSONObject getUserinfoByCard(Integer userId, Integer shopId);

    /**
     * @Description: 获取开卡组件
     * @Param:
     * @return:
     * @Author: bite
     * @Date: 2019/7/10
     */
    JSONObject activateCard(Integer shopId);

    /**
     * @Description: 微信图片/素材上传
     * @Param:
     * @return:
     * @Author: bite
     * @Date: 2019/7/14
     */
    String uploadImg(Integer shopId, MultipartFile file) throws Exception;

    /**
     * @Description: 获取小程序码
     * @Param:
     * @return:
     * @Author: bite
     * @Date: 2019/7/10
     */
    boolean getUnlimited(Integer shopId, Integer userId, String path, String page);

    /**
     * 查询所有小程序首页地址
     *
     * @return 小程序首页信息
     */
    List<MpIndexPageEntity> getAllMpIndexPage();
}
